<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Demo09</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.0.2/vue.global.js"></script>
</head>

<body>
    <div id="app"></div>
</body>
<script>
    const app = Vue.createApp({
        //v:slot 可以绑定对应名字的插槽,简写就直接写个#
        template: ` 
        <h2>欢迎光临红浪漫-请选择您的技师</h2>
        <ji-shi><span style="color:red;">大脚</span></ji-shi>
        <hong-lang-man>
            <template v-slot:one><div>1.女宾一位，请上三楼。</div></template>
            <template v-slot:two><div>3.顾客选择了全身SPA。</div></template>
        </hong-lang-man>
        `
    })
    app.component('JiShi',{
        //在slot里写的就是默认值
        template:`
            <div>
                你选择了<slot><span style="color:green;">晓红</span></slot>为你服务。
            </div>
        `
    })
    app.component('HongLangMan',{
        //具名插槽，就是给插槽起名字，
    template:`
        <div>
                <slot name='one'></slot>
                <div>2.你选择了大脚为你服务</div>
                <slot name='two'></slot>
        </div>
    `
})
    const vm = app.mount("#app")
</script>